技術文章
技術問答
My Project
iT 徵才
聊天室
2026 鐵人賽
登入/註冊
文章
問答
Tag
邦友
鐵人賽
搜尋
2021 iThome 鐵人賽
DAY
24
0
Mobile Development
麻瓜學習 iOS 開發
系列 第
24
篇
Day24:使i用 ForEach、ScrollView 構建 UI
13th鐵人賽
enolazxy
2021-10-09 23:51:19
791 瀏覽
分享至
前言
上篇文章講了加數據進去,
今天來刻 UI。
實作
添加一些 image 進去 asset:
在 app 主頁面中將 image 和 text 並排顯示:
新增一個 RecipeDetailView file:
宣告變數 recipe 符合 class Recipe 的數據類型
建構 UI
用 ForEach 遍歷 recipe 中的 ingredients、directions 數組,
canvas 顯示:
再用一個 VStack 包住所有元素:
留言
追蹤
檢舉
上一篇
Day23:傳入 JSON 文件
下一篇
Day25:NavigationView
系列文
麻瓜學習 iOS 開發
共
30
篇
目錄
RSS系列文
訂閱系列文
2
人訂閱
26
Day26:TabView
27
Day27:用 EnvironmentObject 傳遞數據
28
Day28:Update the Data and the Featured View
29
Day29: Picker controller
30
Day 30 : DetailView
完整目錄
熱門推薦
{{ item.subject }}
{{ item.channelVendor }}
|
{{ item.webinarstarted }}
|
{{ formatDate(item.duration) }}
直播中
立即報名
尚未有邦友留言
立即登入留言
iThome鐵人賽
參賽組數
452
組
團體組數
18
組
累計文章數
4655
篇
最後報名日
9/15
看影片追技術
看更多
{{ item.subject }}
{{ item.channelVendor }}
|
{{ formatDate(item.duration) }}
直播中
熱門tag
15th鐵人賽
16th鐵人賽
13th鐵人賽
14th鐵人賽
17th鐵人賽
12th鐵人賽
11th鐵人賽
鐵人賽
2019鐵人賽
javascript
2018鐵人賽
18th鐵人賽
python
2017鐵人賽
windows
php
c#
linux
windows server
css
熱門問題
excel 查詢web 功能
Nutanix CE硬體要求....
被FortiGate判為惡意網站
熱門回答
被FortiGate判為惡意網站
excel 查詢web 功能
熱門文章
Day 14|Qwen3.8-27B 與 Qwen3.8-Flash-Next 加碼實測:地端模型世代對決與落地評估
Day 27: Playwright MCP:讓 Claude Code 自己打開瀏覽器探索網站
[ 系列導讀 ] Day 1 — 30 天要造什麼:從 MCP 工具標準化到專屬 Agentic 模型的完整閉環
Day 15|Ornith 1.5 實測:為 AI agent 而生的 35B-A3B
完全離線:使用 LiteRT 與 Gemma 4 建置隱私優先的個人理財助理
IT邦幫忙
×
標記使用者
輸入對方的帳號或暱稱
Loading
找不到結果。
標記
{{ result.label }}
{{ result.account }}